<template>
  <view class="custom-nav">
    <view class="search-container" @click="handleSearchClick">
      <image :src="searchIcon" class="search-icon"></image>
    </view>
    <view class="custom-title">{{ title }}</view>
  </view>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '惠商城'
    },
    searchIcon: {
      type: String,
      default: '/static/icon_search_white.png'
    }
  },
  methods: {
    handleSearchClick() {
      this.$emit('search-click');
    }
  }
}
</script>

<style scoped>
.custom-nav {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 160rpx;
  background-color: #ff5218;
  color: white;
}

.search-container {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon {
  width: 24px;
  height: 24px;
  margin-top: 70rpx;
}

.custom-title {
  font-size: 18px;
  text-align: center;
  position: relative;
  width: 200rpx;
  height: 100rpx;
  display: flex;
  margin: 0 auto;
  margin-left: 200rpx;
  margin-top: 120rpx;
  font-weight: bold;
}
</style>